Repository navigation
fix(id): validate world manifest profile bounds and schedule count at parse time (#3015) - #4294
Conversation
… parse time (#3015) WorldManifest::validate() never checked the requested execution profile or the number of pending schedules, so a manifest could parse and plan clean, then fail partway through a live apply when resolve() refused the bounds. - Extract the six bound checks from WorldExecutionProfile::resolve() into WorldExecutionProfile::validate() in id-core; resolve() calls it, so apply-time and parse-time enforcement can never drift. - WorldManifest::validate() now runs profile.validate() and refuses a schedules map longer than MAX_PENDING_SCHEDULES (64). - Parse-level regression tests: each invalid bound rejected, the boundary-valid minima (64 KiB Wasm / 16 MiB native) accepted, 64 schedules accepted and 65 rejected.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The schedule_count_is_capped_at_parse test built its entries with an unescaped quote (format!(""s{i}" = ...")), so the id lib test target did not compile: cargo error at world_manifest.rs:594, expected comma, found {. CI on PR #4294 has been QUEUED since 2026-11-02T09:04Z and never caught it; found by running the targeted tests on the laptop this shift. Escape the quotes. Targeted tests now pass: cargo test --manifest-path pkgs/id/Cargo.toml --lib world_manifest::tests — 17 passed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2229123888
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| #[test] | ||
| fn invalid_profile_bounds_are_rejected() { |
There was a problem hiding this comment.
Prefix the new test functions with
test_
The scoped naming rule in pkgs/id/AGENTS.md explicitly requires test functions to use the test_ prefix. All three newly added tests—invalid_profile_bounds_are_rejected, minimum_profile_bounds_are_accepted, and schedule_count_is_capped_at_parse—omit it. Rename these functions to comply with the documented repository convention.
AGENTS.md reference: pkgs/id/AGENTS.md:L140-L140
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 25c17ef: all three new tests renamed with the test_ prefix per pkgs/id/AGENTS.md (test_invalid_profile_bounds_are_rejected, test_minimum_profile_bounds_are_accepted, test_schedule_count_is_capped_at_parse). Targeted tests re-run on the laptop after the rename: cargo test --manifest-path pkgs/id/Cargo.toml --lib world_manifest::tests — 17 passed.
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Fixes #3015 (queue task 5522):
WorldManifest::validate()never checked the requested execution profile or the pending-schedule count, so an invalid manifest parsed and planned clean, then failed partway through a live apply whenWorldExecutionProfile::resolve()refused the bounds — after earlier apply steps may already have landed.Change
pkgs/id/crates/id-core/src/world_limits.rs: the six bound checks (nonzero wasm_fuel / wasm_message_bytes / native_cpu_seconds / native_call_deadline_ms; wasm_memory_bytes ≥ 64 KiB; native_memory_bytes ≥ 16 MiB) are extracted fromresolve()into a newWorldExecutionProfile::validate();resolve()calls it. One source of truth, so parse-time and apply-time enforcement cannot drift again.pkgs/id/src/world_manifest.rs:WorldManifest::validate()now runsprofile.validate()and refuses aschedulesmap longer thanMAX_PENDING_SCHEDULES(64).Out of scope per the packet: schedule-horizon validation, unknown-key handling (#2876), module_hash docs (#2166), and any change to the limits themselves.
Tests
New parse-level regression tests in
world_manifest.rs: each of the six invalid bounds is rejected byparse(); the boundary-valid minima (64 KiB Wasm memory, 16 MiB native memory) are accepted; a 64-entry schedules map is accepted and a 65-entry map is rejected naming the cap. Verification runs in CI per fleet policy (no local build — laptop load is fleet-contended this shift).